var mysql      = require('mysql');
var connection = mysql.createConnection({
  host     : 'localhost',
  user     : 'root',
  password : 'root',
  database : 'test'
});

connection.connect();

// connection.query("insert into users value (null,'小红','xh@qq.com',0)", function (error, results, fields) {
//   if (error) throw error;
//   console.log('The solution is: ', results);
// });

connection.query("select * from users", function (error, results, fields) {
  if (error) throw error;
  results.forEach(function(item){
  	console.log(item)
  })
  // console.log('The solution is: ', results);
});


connection.end();